//
//  SYDSRWebsocketManage.h
//  PinGJByOwnerSide
//
//  Created by lantaiyuan on 2017/9/8.
//  Copyright © 2017年 lantaiyuan. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <SocketRocket/SRWebSocket.h>

@protocol getMessageDelegate <NSObject>

-(void)getMessageFromSocket:(NSDictionary *)message;

@end

@interface SYDSRWebsocketManage : NSObject<SRWebSocketDelegate>//socket协议

@property(nonatomic,assign)id <getMessageDelegate>delegate;
@property(nonatomic,strong)SRWebSocket *socket;

//外部调用传入链接URL
- (void)WithIP:(NSString *)URLIP;

//外部控制打开webSocket(拿到接口传给的URL之后)
- (void)openSocket;

//外部调用控制关闭webSocket
- (void)closeSocket;

//ping pong 心跳链接
- (void)sendHeart;

//外部聊天发送消息
- (void)sendTalkMessage:(NSDictionary *)message;

@end
